<template>
  <el-select v-bind="$attrs" v-on="$listeners">
    <template v-if="isGroup">
      <el-option-group v-for="group in options" :key="group.label" :label="group.label">
        <el-option v-for="v of group.options" :key="v.key || v.value" :label="v.label" :value="v.value" :disabled="v.disabled || false" />
      </el-option-group>
    </template>
    <template v-else>
      <el-option v-for="v of options" :key="v.value" :label="v.label" :value="v.value" :disabled="v.disabled || false" />
    </template>

  </el-select>
</template>

<script>
export default {
  name: 'MySelect',
  props: {
    options: { type: Array, default: () => [] },
    isGroup: { type: Boolean, default: false }
  }
}
</script>

<style>

</style>
